package com.example.demo.singleton;

import org.apache.catalina.User;

/***
 * SINGLETON模式
 */
public class UserDatabaseSource implements UserDatabase {

    private static UserDatabase theInstance = new UserDatabaseSource();

    public static UserDatabase instance(){
        return theInstance;
    }

    private UserDatabaseSource(){}
    @Override
    public User readUser(String userName) {
        // some thing...
        return null;
    }

    @Override
    public void writeUser(User user) {

    }
}
